package com.fr.report.cellElement;

import com.fr.base.XMLable;
import com.fr.base.xml.XMLPrintWriter;
import com.fr.base.xml.XMLableReader;

public class CellPageAttr
  implements XMLable
{
  private static final long serialVersionUID = 1L;
  public static CellPageAttr DEFAULT_CELLPAGEATTR = new CellPageAttr();
  private static final int NOT_PAGE_AFTER_COL = 1;
  private static final int NOT_PAGE_AFTER_ROW = 2;
  private static final int NOT_PAGE_BEFORE_COL = 4;
  private static final int NOT_PAGE_BEFORE_ROW = 8;
  private static final int REPEAT = 16;
  private byte value = 31;

  public boolean isPageAfterColumn()
  {
    return ((this.value & 0x1) == 0);
  }

  public void setPageAfterColumn(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      CellPageAttr tmp5_4 = this;
      tmp5_4.value = (byte)(tmp5_4.value & 0xFFFFFFFE);
    }
    else
    {
      CellPageAttr tmp20_19 = this;
      tmp20_19.value = (byte)(tmp20_19.value | 0x1);
    }
  }

  public boolean isPageAfterRow()
  {
    return ((this.value & 0x2) == 0);
  }

  public void setPageAfterRow(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      CellPageAttr tmp5_4 = this;
      tmp5_4.value = (byte)(tmp5_4.value & 0xFFFFFFFD);
    }
    else
    {
      CellPageAttr tmp20_19 = this;
      tmp20_19.value = (byte)(tmp20_19.value | 0x1);
    }
  }

  public boolean isPageBeforeColumn()
  {
    return ((this.value & 0x4) == 0);
  }

  public void setPageBeforeColumn(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      CellPageAttr tmp5_4 = this;
      tmp5_4.value = (byte)(tmp5_4.value & 0xFFFFFFFB);
    }
    else
    {
      CellPageAttr tmp20_19 = this;
      tmp20_19.value = (byte)(tmp20_19.value | 0x4);
    }
  }

  public boolean isPageBeforeRow()
  {
    return ((this.value & 0x8) == 0);
  }

  public void setPageBeforeRow(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      CellPageAttr tmp5_4 = this;
      tmp5_4.value = (byte)(tmp5_4.value & 0xFFFFFFF7);
    }
    else
    {
      CellPageAttr tmp20_19 = this;
      tmp20_19.value = (byte)(tmp20_19.value | 0x8);
    }
  }

  public boolean isRepeat()
  {
    return ((this.value & 0x10) != 0);
  }

  public void setRepeat(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      CellPageAttr tmp5_4 = this;
      tmp5_4.value = (byte)(tmp5_4.value | 0x10);
    }
    else
    {
      CellPageAttr tmp20_19 = this;
      tmp20_19.value = (byte)(tmp20_19.value & 0xFFFFFFEF);
    }
  }

  public void readXML(XMLableReader paramXMLableReader)
  {
    if (paramXMLableReader.isAttr())
    {
      String str;
      if ((str = paramXMLableReader.getAttr("pageAfterColumn")) != null)
        setPageAfterColumn(Boolean.valueOf(str).booleanValue());
      if ((str = paramXMLableReader.getAttr("pageAfterRow")) != null)
        setPageAfterRow(Boolean.valueOf(str).booleanValue());
      if ((str = paramXMLableReader.getAttr("pageBeforeColumn")) != null)
        setPageBeforeColumn(Boolean.valueOf(str).booleanValue());
      if ((str = paramXMLableReader.getAttr("pageBeforeRow")) != null)
        setPageBeforeRow(Boolean.valueOf(str).booleanValue());
      if ((str = paramXMLableReader.getAttr("repeat")) != null)
        setRepeat(Boolean.valueOf(str).booleanValue());
    }
  }

  public void writeXML(XMLPrintWriter paramXMLPrintWriter)
  {
    paramXMLPrintWriter.startTAG("CellPageAttr");
    if (isPageAfterColumn())
      paramXMLPrintWriter.attr("pageAfterColumn", "true");
    if (isPageAfterRow())
      paramXMLPrintWriter.attr("pageAfterRow", "true");
    if (isPageBeforeColumn())
      paramXMLPrintWriter.attr("pageBeforeColumn", "true");
    if (isPageBeforeRow())
      paramXMLPrintWriter.attr("pageBeforeRow", "true");
    if (!(isRepeat()))
      paramXMLPrintWriter.attr("repeat", "false");
    paramXMLPrintWriter.end();
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return super.clone();
  }
}